{layout name="../common/master"/}
<div id="right">
  <h4>
      <div class="btn-group">
          <a href="{$_SERVER['HTTP_REFERER']}" class="btn btn-success">返回</a>  {if condition="!empty($data)"}<span>统计日期：{:date("Y-m-d H:i:s",$data['create_time'])}</span>{/if}
      </div>
  </h4>
    <form action="" method="get" role="form">
        <div class="form-group">
            <input type="text" style="width: 200px;float: left;margin-right: 20px" class="form-control" {if condition="isset($_GET['date'])"}value="{$_GET['date']}"{/if} name="date" onclick="WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})" placeholder="请输入统计日期">
        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
    <div>
        <button type="submit" id="extend" class="btn btn-success">导出到Excel</button>
    </div>
    {if condition="!empty($data)"}
    <div class="panel panel-default col-lg-5">
        <div class="panel-heading">
            <h3 class="panel-title">还款金额统计</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>待还款总额</th>
                    <td>{$data['totalNeedRepayMoney']}</td>
                </tr>
                <tr>
                    <th>到期总额</th>
                    <td>{$data['totalExpireMoney']}</td>
                </tr>
                <tr>
                    <th>昨日新增到期总额</th>
                    <td>{$data['moreExpireMoney']}</td>
                </tr>
                <tr>
                    <th>已还款总额</th>
                    <td>{$data['totalRepayMoney']}</td>
                </tr>
                <tr>
                    <th>昨日新增还款额</th>
                    <td></td>
                </tr>
                <tr>
                    <th>提前还款额</th>
                    <td>{$data['beforeRepayMoney']}</td>
                </tr>
                <tr>
                    <th>按时还款额</th>
                    <td>{$data['onTimeRepayMoney']}</td>
                </tr>
                <tr>
                    <th>逾期1-3天还款额</th>
                    <td>{$data['dueOneToThreeRepayMoney']}</td>
                </tr>
                <tr>
                    <th>逾期4-7天还款额</th>
                    <td>{$data['dueFourToSevenRepayMoney']}</td>
                </tr>
                <tr>
                    <th>逾期8-15天还款额</th>
                    <td>{$data['dueEightToFifteenRepayMoney']}</td>
                </tr>
                <tr>
                    <th>逾期16-30天还款额</th>
                    <td>{$data['dueSixteenToThrityRepayMoney']}</td>
                </tr>
                <tr>
                    <th>坏账还款额</th>
                    <td>{$data['dueMoreThrityRepayMoney']}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="panel panel-default col-lg-5 col-lg-offset-1">
        <div class="panel-heading">
            <h3 class="panel-title">还款笔数统计</h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-bordered">
                <tbody>
                <tr>
                    <th>待还款总笔数</th>
                    <td>{$data['totalNeedRepayCount']}</td>
                </tr>
                <tr>
                    <th>到期总笔数</th>
                    <td>{$data['totalExpireCount']}</td>
                </tr>
                <tr>
                    <th>昨日新增到期笔数</th>
                    <td>{$data['moreExoireCount']}</td>
                </tr>
                <tr>
                    <th>已还款总笔数</th>
                    <td>{$data['totalUserLoan']}</td>
                </tr>
                <tr>
                    <th>昨日新增还款笔数</th>
                    <td></td>
                </tr>
                <tr>
                    <th>提前还款笔数</th>
                    <td>{$data['beforeRepayCount']}</td>
                </tr>
                <tr>
                    <th>按时还款笔数</th>
                    <td>{$data['onTimeRepayCount']}</td>
                </tr>
                <tr>
                    <th>逾期1-3天还款笔数</th>
                    <td>{$data['dueOneToThreeRepayCount']}</td>
                </tr>
                <tr>
                    <th>逾期4-7天还款笔数</th>
                    <td>{$data['dueFourToSevenRepayCount']}</td>
                </tr>
                <tr>
                    <th>逾期8-15天还款笔数</th>
                    <td>{$data['dueEightToFifteenRepayCount']}</td>
                </tr>
                <tr>
                    <th>逾期16-30天还款笔数</th>
                    <td>{$data['dueSixteenToThrityRepayCount']}</td>
                </tr>
                <tr>
                    <th>坏账还款笔数</th>
                    <td>{$data['dieMoreThrityRepayCount']}</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    {else/}
    <div style="color: red;">
        暂无数据
    </div>
    {/if}


</div>
<script>
    $("#extend").click(function(){
        var url="{:URL('home/Analyse/daily',$_GET)}";
        url=url+"&extend=1";
        location.href=url;
    })
</script>
<script type="text/javascript" src="__PUBLIC__/home/tuo/DatePicker/WdatePicker.js"></script>